package com.tailyou.androidlearning202400.kl

//fun main() {

    //var phone1 = Phone("华为","Pura 70 Pro")
    //phone1.brand = "华为"
    //phone1.model = "Pura 70 Pro"

    //var phone2 = Phone();
    //phone1.call("WPY")
//}


fun main() {
    //全参构造函数创建对象
    val phone1 = Phone("华为","Pura 70 Pro")
    phone1.call("WPY")

    //空参构造函数创建对象
    val phone2 = Phone()
    phone2.brand = "华为"
    phone2.model = "Pura 70 Pro"
    phone2.call("WPY")

    //定义子类的对象
    val phone3 = HWPhone("白色",8000f)
    phone3.brand = "华为"
    phone3.model = "Meta60Pro"
    phone3.printInfo()
    phone3.call("WPY")
}
